<?php
/**
 * Created by 王跃达.
 * User: 小马出行
 * Date: 2017/8/24
 * Time: 16:17
 */

namespace app\api\model;


use think\Db;
use think\Model;

class EveryModel extends Model
{


    public function __construct()
    {
        parent::__construct();

    }

    /**
     * 根据Uid zone获取首单优惠
     */

    public function getEveryByUidAndZone($zone_id)
    {
        $where['zone_id'] = array(array("eq", 0), array("eq", $zone_id),"or");
        $where['start_time'] = array("elt", time());
        $where['end_time'] = array("gt", time());
        $every = Db::name("every")->field("every_id,minus_money")->where($where)->find();
        return $every;
    }


}